package com.dongway.netcondition.service;

import java.util.List;

import org.springframework.stereotype.Service;

import com.dongway.core.common.Paginator;
import com.dongway.core.service.BaseService;
import com.dongway.netcondition.model.DevRecord;

@Service
public class DevRecordService extends BaseService {

    public List<DevRecord> all(Paginator paginator) {
        String sql = "select * from t_dev_record";
        return getDao().query(DevRecord.class, sql, paginator);
    }
    
    public List<DevRecord>queryBytime(String startTime,String endTime,Paginator paginator){
       	String sql = "select * from t_dev_record where time between DATE_FORMAT(?,'%Y-%m-%d') and DATE_FORMAT(?, '%Y-%m-%d')"; 
       	return getDao().query(DevRecord.class, sql, paginator, startTime, endTime);

    }

    public void save(DevRecord record) {
        getDao().save(record);
    }
}
